#
# Copyright (C) 2023
#
# Brick Yang <printfxxx@163.com>
#
# This program is free software. You can redistribute it and/or
# modify it as you like.
#

mtrace_srcs = files('mtrace.c')

mtrace_incs = include_directories('.')

mtrace_kcflags = ['-I' + meson.current_source_dir()]

if cfgs.get('mtrace') == true
	mtrace_cflags   = ['-DMTRACE']
	mtrace_kcflags += ['-DMTRACE']

	mtrace_libs = static_library('mtrace', mtrace_srcs, c_args: [mtrace_cflags, '-include', 'sys_api.h'])

	mtrace_deps = declare_dependency(compile_args: mtrace_cflags, link_args: mtrace_ldflags,
					 include_directories: mtrace_incs, link_with: mtrace_libs)
else
	mtrace_deps = declare_dependency(include_directories: mtrace_incs)
endif
